package cn.ethan.demo.design;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 *
 *
 * @author 张俊辉
 */
public class DecorationPackageMenu implements Menu {
    /**
     * 装修清单
     */
    private List<Matter> list = new ArrayList<>();
    /**
     * 装修价格
     */
    private BigDecimal price = BigDecimal.ZERO;
    /**
     * 面积
     */
    private BigDecimal area;
    /**
     * 装修等级
     */
    private String grade;


    @Override
    public Menu appendCelling(Matter matter) {
        list.add(matter);
        price = price.add(area.multiply(new BigDecimal("0.2")).multiply(matter.price()));
        return this;
    }

    @Override
    public Menu appendCoat(Matter matter) {
        list.add(matter);
        price = price.add(area.multiply(new BigDecimal("1.4")).multiply(matter.price()));
        return this;
    }

    @Override
    public Menu appendFloor(Matter matter) {
        list.add(matter);
        price = price.add(area.multiply(matter.price()));
        return this;
    }

    @Override
    public Menu appendTile(Matter matter) {
        list.add(matter);
        price = price.add(area.multiply(matter.price()));
        return this;
    }

    @Override
    public String getDetail() {

        return "";
    }
}
